﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="showin.aspx.cs" Inherits="lcs.Web.Admin.showin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1 {
            width: 387px;
        }
        .auto-style2 {
            width: 18px;
            height: 18px;
        }
        .auto-style3 {
            width: 153px;
        }
         .b { border-collapse:separate;
            border-spacing:1px;
            margin:5px;
        }
    </style>
    <link href="lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    
    <script src="lib/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script src="lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
    <script src="lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
    <script src="lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
    <script src="../Scripts/mybase.js"></script>
    <script src="../js/CheckBox.js"></script>
    <link href="../jquery-ui.min.css" rel="stylesheet" />    
    <script src="../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtKeyword.ClientID%>").autocomplete({
                 minLength:2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
    <script type="text/javascript">

        var win1;        
        function f_open(id) {
            var ul = 'shows.aspx?id=' + id;            
                win1 = $.ligerDialog.open({ url: ul, height: 450, isResize: true, width: 600, showMax: false, showToggle: false, modal: true, isResize: true, slide: true, title: '操作', onClosed: function () { alert('asdf'); } });
          }
        function update()
        {
            $("#<%= btnSearch.ClientID %>").click();
        }
        function checksel()
        {
            if ($("#<%= gridView.ClientID %> tr :checkbox:checked").length > 0)
                return true;
            else
            { alert('没有选择任何行！'); return false;}
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <table style="width:100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td style="text-align:right;" align="right" class="auto-style3" >
                         <b>物料类型：</b><asp:DropDownList ID="ddltype" runat="server">
                             <asp:ListItem Value="-1">全部</asp:ListItem>
                             <asp:ListItem Selected="True" Value="0">正常</asp:ListItem>
                             <asp:ListItem Value="1">节余</asp:ListItem>
                             <asp:ListItem Value="2">废旧</asp:ListItem>
                             <asp:ListItem Value="3">回收</asp:ListItem>
                         </asp:DropDownList></td>
                    <td class="auto-style1">                       
                         <b>项目：</b>
                    <asp:TextBox ID="txtKeyword" runat="server"></asp:TextBox>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="tdbg">
            <asp:Label ID="lblmsg" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>            <!--Search end-->
            
            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="100%" BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"  OnPageIndexChanging ="gridView_PageIndexChanging"
                     DataKeyNames="mid" OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" OnRowCreated="gridView_OnRowCreated" PageSize="15">
                    <Columns>
                    <asp:TemplateField ControlStyle-Width="30" HeaderText="选择"    >
                                <ItemTemplate>
                                    <asp:CheckBox ID="DeleteThis" runat="server" />
                                </ItemTemplate>
                       <HeaderTemplate>
                           <input id="allbox" type="checkbox" name="allbox" onclick="javascript: CA();"/>
                       </HeaderTemplate>

<ControlStyle Width="30px"></ControlStyle>
                            </asp:TemplateField> 
                            
		                <asp:TemplateField HeaderText="入库">
                            <ItemTemplate>
                                <img alt="" class="auto-style2" src="images/add.gif" onclick="f_open(<%# Eval("mid") %>)" style='display:<%# getin(Eval("user_name").ToString())%>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                            
		<asp:BoundField DataField="proid" HeaderText="项目编号" SortExpression="proid" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="usework" HeaderText="需用单位" SortExpression="usework" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:TemplateField HeaderText="项目名称">                            
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Decode(Eval("projectname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
		<asp:BoundField DataField="projecttype" HeaderText="项目类型" SortExpression="projecttype" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="supplier" HeaderText="供应商名称" SortExpression="supplier" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="material" HeaderText="物料描述" SortExpression="material" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="nums" HeaderText="总数量" SortExpression="nums" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="havenums" HeaderText="剩余数量" SortExpression="nums" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="unit" HeaderText="单位" SortExpression="unit" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="user_name" HeaderText="物料员" SortExpression="user_name" ItemStyle-HorizontalAlign="Center"  > 
                        <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                         <asp:BoundField DataField="mtypecn" HeaderText="物料类型" ItemStyle-HorizontalAlign="Center"  />  
                        <asp:BoundField DataField="remark" HeaderText="计划备注" />  
                            <asp:HyperLinkField HeaderText="详细" ControlStyle-Width="50" DataNavigateUrlFields="mid" DataNavigateUrlFormatString="materialinfo/Show.aspx?id={0}"
                                Text="详细" Visible="False"  >
<ControlStyle Width="50px"></ControlStyle>
                        </asp:HyperLinkField>
                        </Columns>

                    <PagerStyle CssClass="mypager" />

<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>
               <table border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
                <tr>
                    <td style="width: 1px;">                        
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlmaterial" runat="server" Visible="False">
                        </asp:DropDownList>
                        <asp:Button ID="btnsetmaterial" runat="server" OnClick="btnsetmaterial_Click" Text="设置物料员" OnClientClick="return checksel();" Visible="False" />
                        <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" OnClientClick="return checksel();"/>                       
                    </td>
                </tr>
            </table>
</asp:Content>
